
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title>售后服务</title>
<link rel="shortcut icon" href="easyui/css/images/favicon.ico" />
<link rel="stylesheet" href="css/flipclock.css">
<link href="css/CalcSS3.css" rel="stylesheet" type="text/css" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
<link href="easyui/css/easyui.css" rel="stylesheet" type="text/css">
<link href="easyui/css/easyui_animation.css" rel="stylesheet"
	type="text/css">
<link href="easyui/css/easyui_plus.css" rel="stylesheet" type="text/css">
<link href="easyui/css/insdep_theme_default.css" rel="stylesheet"
	type="text/css">
<link href="easyui/css/icon.css" rel="stylesheet" type="text/css">
<link href="easyui/css/font-awesome-4.7.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<!-- 引入 ECharts 文件 -->
<script src="js/echarts.js"></script>
<!--放入自定义的图表-->
<script src="js/monitor.js"></script>
<script type="text/javascript" src="easyui/js/jquery.min.js"></script>
<script type="text/javascript" src="easyui/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="easyui/js/jquery.insdep-extend.min.js"></script>
</head>
<body>
	<style>
.by {
	padding: 10px;
	text-align: center;
}
</style>
	<!-- 引入公用表格和表单样式 -->
	<link href="css/utils/utilsDatagrid.css" rel="stylesheet"
		type="text/css">
	<link href="css/utils/utilsForm.css" rel="stylesheet" type="text/css">
	<link href="css/client/client.css" rel="stylesheet" type="text/css">


	<script type="text/javascript" src="js/after-sale/after-sale-server.js"></script>

	<!-- 头部搜索框 -->
	<div class="client-searchbox-div">
		<input id="after-sale-server-searchbox" class="easyui-searchbox"
			style="width: 300px;"
			data-options="menu:'#after-sale-server-searchbox-checkbox',labelWidth:80"></input>

		<div id="after-sale-server-searchbox-checkbox" style="width: 120px"
			data-options="left:5">
			<div data-options="name:'serverId',selected:true">关怀编号</div>
			<div data-options="name:'theme'">关怀主题</div>
		</div>

	</div>


	<div>
		<table id="jm-after-sale-server-datagrid"
			class="easyui-datagrid table-chance" style="width: 100%"
			data-options="striped:true,height:350,fitColumns:true,border:false,
					   autoRowHeight:true,nowrap:false,pagination:true,toolbar:'#jm-after-sale-server-datagrid-tools',url:'find-after-sale-server-by-page',method:'post',
					pageList:[5,10,15,20],pageSize:5">
			<thead>
				<tr class="datagrid-header-row">
					<th
						data-options="field:'code',width:10,align:'center',checkbox:true">编码</th>
					<th data-options="field:'serverId',width:10,align:'center'">ID</th>
					<th data-options="field:'theme',width:40,align:'center'">主题</th>
					<th
						data-options="field:'clientId',width:40,align:'center',formatter:function(value,row,index){
								var result;
								$.ajax({
									url:'find-contact-by-contactid', 
									async:false,//改为同步请求
									type:'POST',
									data:{contactid:row.clientId},
									success:function(e){
										result = e.clientInfo.cname;
									}
								});
								return result;
							}">对应客户</th>
					<th data-options="field:'type',width:30,align:'center'">服务类型</th>
					<th data-options="field:'way',width:30,align:'center'">服务方式</th>
					<th data-options="field:'startTime',width:30,align:'center'">开始日期</th>
					<th
						data-options="field:'exertId',width:40,align:'center',formatter:function(value,row,index){
								var result;
								$.ajax({
									url:'client-get-userName', 
									async:false,//改为同步请求
									type:'POST',
									data:{uId:row.exertId},
									success:function(e){
										result = e;
									}
								});
								return result;
							}">执行人</th>
					<th data-options="field:'spendTime',width:40,align:'center'">花费时间</th>
					<th
						data-options="field:'state',width:40,align:'center',formatter:function(value){
							var image = '';
							if(value == '未处理'){
								image = 'images/after-sale/gantanhao.png';
							}else if(value == '处理中'){
								image = 'images/after-sale/you-jian-tou.png';
							}else if(value == '处理完成'){
								image = 'images/after-sale/gou.png';
							}
							return '<img src='+image+'>';
						}">状态</th>
					<th data-options="field:'caozuo',width:40,align:'center'"
						formatter="format">操作</th>

				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
		<!--datagrid工具栏-->
		<div id="jm-after-sale-server-datagrid-tools">
			<a id="after-sale-server-tools-btn-add" class="easyui-linkbutton"
				data-options="iconCls:'icon-mini_add2',plain:true">新建</a> <a
				id="after-sale-server-tools-btn-remove" href="#"
				class="easyui-linkbutton"
				data-options="iconCls:'icon-my_delete',plain:true">删除</a> <a
				id="after-sale-server-tools-btn-selectAll" class="easyui-linkbutton"
				data-options="iconCls:'icon-my_search',plain:true">查询所有</a>
		</div>

		<!-- 新建售后服务对话框 -->
		<div id="add-after-sale-server-dialog" class="easyui-dialog"
			style="background-color: #EBEFF2;"
			data-options="title:'客户服务',
						iconCls:'icon-save2',
						width:750,
						height:580,
						closed:true,
						href:'to-add-after-sale-server-from',
						bodyCls:'by',
						shadow:true,
						buttons:[{
							text:'保存',
							iconCls:'icon-ok2',
							handler:function(){
								$('#add-after-sale-server-form').form({
									url:'add-after-sale-server',
									onSubmit:function(parmps){
										//进行验证
										return $(this).form('validate');
									},
									success:function(r){
										//点击关闭，则窗口关闭
										$.messager.alert('成功', '恭喜，成功添加客户服务！');
										$('#add-after-sale-server-dialog').window('close');
										$('#add-after-sale-server-form').form('clear');
		            					$('#jm-after-sale-server-datagrid').datagrid('reload');
									}
								}).submit();
							}
						},
						{
							text:'关闭',
							iconCls:'icon-cancel2',
							handler:function(){
								//点击关闭，则窗口关闭
								$('#add-after-sale-server-dialog').window('close');
							}
						}
						]
						 "></div>
		<!-- 编辑客户关怀对话框 -->
		<div id="edit-after-sale-server-dialog" class="easyui-dialog"
			style="background-color: #EBEFF2;"
			data-options="title:'客户服务',
						iconCls:'icon-save2',
						width:750,
						height:580,
						closed:true,
						href:'to-edit-after-sale-server-from',
						bodyCls:'by',
						shadow:true,
						buttons:[{
							text:'保存',
							iconCls:'icon-ok2',
							handler:function(){
								$('#edit-after-sale-server-form').form({
									url:'edit-after-sale-server',
									onSubmit:function(parmps){
										//进行验证
										return $(this).form('validate');
									},
									success:function(r){
										//点击关闭，则窗口关闭
										$.messager.alert('成功', '恭喜，成功编辑联系人纪念日！');
										$('#edit-after-sale-server-dialog').window('close');
										$('#edit-after-sale-server-form').form('clear');
		            					$('#jm-after-sale-server-datagrid').datagrid('reload');
									}
								}).submit();
							}
						},
						{
							text:'关闭',
							iconCls:'icon-cancel2',
							handler:function(){
								//点击关闭，则窗口关闭
								$('#edit-after-sale-server-dialog').window('close');
							}
						}
						]
						 "></div>

		<!-- 客户关怀视图对话框 -->
		<div id="view-after-sale-server-dialog" class="easyui-dialog"
			style="background-color: #EBEFF2;"
			data-options="title:'售后服务',
						iconCls:'icon-save2',
						width:750,
						height:580,
						closed:true,
						href:'to-view-after-sale-server-from',
						bodyCls:'by',
						shadow:true,
						
						 "></div>
	</div>
</body>
</html>